<template>
	<view>
		<view class="real_box">
			<view v-for="(grpItem,grpIdx) in real_group" :key="grpIdx">
				<view class="real_title">{{grpItem.title}}</view>
				<view class="real_list">
					<view class="real_item" v-for="(item,index) in grpItem.realList" :key="index" @tap="to(item)">
						<image :src="item.src"></image>
						<view class="text">{{item.name}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		hasOwner
	} from '@/api/owner/ownerApi.js'
	export default {
		name: "serviceProperty",
		data() {
			return {
				real_group: [],
			};
		},
		created() {
			this._loadMenu();
		},
		methods: {
			to: function(v) {
				if (v.name == '商圈') {
					uni.switchTab({
						url: v.href
					})
				} else if (v.href != '') {
					if (v.needLogin == 'N') {
						this.vc.navigateTo({
							url: v.href
						});
						return;
					}
					hasOwner();
					this.vc.navigateTo({
						url: v.href
					});

				} else {
					uni.showToast({
						icon: 'none',
						title: '此功能暂不开放'
					})
				}
			},
			_loadMenu: function() {
				// const imgUrl = this.imgUrl;
				const imgUrl = '/static';
				this.real_group = [{
						title: '物业服务',
						realList: [{
								name: '投诉咨询',
								src: imgUrl + '/images/serve/4.png',
								href: '/pages/complaint/complaint'
							},
							{
								name: '报事维修',
								src: imgUrl + '/images/serve/6.png',
								href: '/pages/repair/repair'
							},
							{
								name: '装修报备',
								src: imgUrl + '/images/serve/10.png',
								href: '/pages/renovation/roomRenovation'
							},
							{
								name: "车位申请",
								src: imgUrl + "/images/serve/my6.png",
								href: "/pages/applyparking/applyparking"
							},
						]
					},
					{
						title: '智慧生活',
						realList: [{
								name: '生活缴费',
								src: imgUrl + '/images/serve/1.png',
								href: '/pages/fee/oweFee'
							},
							{
								name: '房屋费',
								src: imgUrl + '/images/serve/5.png',
								href: '/pages/fee/roomFeeListNew'
							}, {
								name: '停车费',
								src: imgUrl + '/images/serve/9.png',
								href: '/pages/fee/payParkingFeeList'
							}, {
								name: '合同费',
								src: imgUrl + '/images/serve/12.png',
								href: '/pages/fee/contractFeeList'
							},
							{
								name: '水电充值',
								src: imgUrl + '/images/serve/5.png',
								href: '/pages/meter/meter'
							},
							{
								name: '访客通行',
								src: imgUrl + '/images/serve/3.png',
								href: '/pages/visit/visitList'
							},
							{
								name: '预约服务',
								src: imgUrl + '/images/serve/order4.png',
								href: '/pages/reserve/reserveService'
							},
							{
								name: '物品放行',
								src: imgUrl + '/images/serve/order4.png',
								href: '/pages/itemRelease/itemRelease'
							},
							{
								name: '空置房申请',
								src: imgUrl + '/images/serve/my9.png',
								href: '/pages/applyRoom/applyRoom'
							},
						],
					},
					{
						title: '业主房产',
						realList: [{
								name: '业主信息',
								src: imgUrl + '/images/serve/my1.png',
								href: '/pages/viewBindOwner/viewBindOwner'
							},
							{
								name: '家庭成员',
								src: imgUrl + '/images/serve/2.png',
								href: '/pages/family/familyList'
							},
						],
					},
					{
						title: '其他功能',
						realList: [
							// {
							// 	name: '二维码交费',
							// 	src: this.imgUrl+'/images/serve/1.png',
							// 	href: '/pages/fee/payQrCode?communityId=2023052267100146&pfqId=102023091363230004'
							// },

							{
								name: '社区公告',
								src: imgUrl + '/images/serve/7.png',
								href: '/pages/notice/index'
							},
							{
								name: '一键开门',
								src: imgUrl + '/images/serve/8.png',
								href: '/pages/machine/openDoor'
							},
							{
								name: "投票问卷",
								src: imgUrl + "/images/serve/my2.png",
								href: "/pages/questionAnswer/questionAnswer"
							},
							{
								name: '球场预约',
								src: imgUrl + '/images/serve/order4.png',
								href: '/pages/appointment/appointment'
							},
							{
								name: '智能充电',
								src: imgUrl + '/images/serve/my3.png',
								href: '/pages/machine/chargeMachines',
								needLogin: 'N'
							},
							{
								name: '物业打分',
								src: imgUrl + '/images/serve/my9.png',
								href: '/pages/complaint/examineStaff'
							},
							{
								name: '小区公示',
								src: imgUrl + '/images/serve/my1.png',
								href: '/pages/common/communityPublicity'
							},
							// {
							// 	name: "返省上报",
							// 	src: imgUrl + "/images/serve/my3.png",
							// 	href: "/pages/reportInfoBack/reportInfoBack",
							// 	needLogin: 'N'
							// },

							// {
							// 	name: '设备',
							// 	src: imgUrl + '/images/serve/order4.png',
							// 	href: '/pages/machine/machine?machineId=102022110791780032&communityId=2022110264250009'
							// },
						]
					}
				]
			}
		}
	}
</script>

<style lang="less">
	.real_box {
		padding: 0;
		background: #fff;
		margin: 0;

		.real_title {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 32upx 0 0 32upx;
			font-size: 26upx;
			font-weight: 500;
			color: grey;
		}

		.real_list {
			border-radius: 5px;
		}

		.real_item {
			display: inline-block;
			padding: 16upx 24upx;
			width: 25%;
			text-align: center;
			font-size: 28upx;

			image {
				height: 72upx;
				width: 72upx;
			}

			.text {
				white-space: nowrap;
				font-size: 24upx;
				font-weight: 400;
			}
		}
	}
</style>